package edu.zut.cs.software.perfect.student.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import edu.zut.cs.software.perfect.base.domain.BaseEntity;

/**
 * @ClassName student
 * @Description TODO
 * @Author jihao
 * @Date 2020年4月11日 下午4:51:35
 * @Version 1.0
 */

@Table(name = "T_STUDENT")
@Entity
public class Student extends BaseEntity<Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7666540832218415285L;
	/**
	 * attribute for student
	 */
	@Column(name = "NAME")
	String name;
	/**
	 * name for student
	 */
	
	@Column(name = "ID")
	long id;
	/**
	 * id for student
	 */

	@Column(name = "GRADE")
	String grade;
	/**
	 * grade for student
	 */
	
	@Column(name = "SEX")
	String sex;
	/**
	 * sex for student
	 */

	@Column(name = "OLD")
	String old;
	/**
	 * old for student
	 */
	
	@Column(name = "CLASSID")
	String classid;
	/**
	 * classid for student
	 */

	@Column(name = "POST")
	String post;
	/**
	 * post for student
	 */
	
	/**
	 * Many Students objects relate to one Class.
	 */
	@ManyToOne
	@JoinColumn(name = "CLASS_ID")
	Classes Classes;
	
	public String getSex() {
		return sex;
	}

	public Classes getClasses() {
		return Classes;
	}

	public void setClasses(Classes classes) {
		Classes = classes;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getOld() {
		return old;
	}

	public void setOld(String old) {
		this.old = old;
	}

	public String getClassid() {
		return classid;
	}

	public void setClassid(String classid) {
		this.classid = classid;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
	}
}
